package com.doone.telmarket.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.doone.telmarket.domain.OrderSort;
import com.doone.telmarket.domain.ServiceProduct;
import com.doone.telmarket.domain.ServiceProductView;
import com.doone.telmarket.infrastructure.dao.ServiceProductDAO;
import com.doone.telmarket.vo.HotBusiVo;
import com.doone.telmarket.vo.ServiceVo;

/**
 * @package
 * @author 甘雨波
 * @description 产品类别操作接口实现类
 * @date 2009-10-13
 */
@Service("serviceProductOperation")
public class ServiceProductOprationImpl implements ServiceProductOperation {

	@Autowired
	private ServiceProductDAO serviceProductDao;

	public void deleteByPrimaryKey(String serviceProduct) {
		serviceProductDao.deleteServiceProductByPrimaryKey(serviceProduct);

	}

	public void deleteByServiceCode(int serviceCode) {
		serviceProductDao.deleteServiceProductByServiceCode(serviceCode);

	}

	public ServiceProduct saveServiceProduct(ServiceProduct serviceProduct) {
		return serviceProductDao.saveServiceProduct(serviceProduct);
	}

	public List<OrderSort> selectOrderSort() {
		return serviceProductDao.selectServiceOrderSort();
	}

	public int selectBuyCount(String id) {
		return serviceProductDao.selectBuyCount(id);
	}

	public int selectScCount(int id) {
		return serviceProductDao.selectScCount(id);
	}

	public List<ServiceProductView> getNextPage(int page, String serviceTypeName) {
		return serviceProductDao.getNextPage(page, serviceTypeName);
	}

	public List<ServiceProductView> getPriviPage(int page, String serviceTypeName) {
		return serviceProductDao.getPriviPage(page, serviceTypeName);
	}

	public List<ServiceProductView> getEndPage(String serviceTypeName) {
		return serviceProductDao.getEndPage(serviceTypeName);
	}

	public int getMaxPage(String serviceTypeName) {
		return serviceProductDao.getMaxPage(serviceTypeName);
	}

	public List<ServiceProduct> getProductByServiceType(String typeName) {
		return serviceProductDao.getProductByType(typeName);
	}

	public void saveHotBusi(ServiceProductView productView) {
		serviceProductDao.saveHotBusi(productView);
	}

	public List<ServiceProductView> selectIndexHotBusi(String serviceTypeName) {
		return serviceProductDao.selectIndexHotBusi(serviceTypeName);
	}

	public List<ServiceProductView> getProductView(ServiceVo sv) {
		return serviceProductDao.getProductView(sv);
	}

	public void deleteHotByServiceTypeName(String serviceTypeName) {
		serviceProductDao.deleteHotBusiByTypeName(serviceTypeName);
	}

	public void deleteHotBusi(String type) {
		serviceProductDao.deleteHotBusi(type);
	}

	public void insertHotBusi(HotBusiVo view) {

		System.out.println("serviceProductDao:" + serviceProductDao);

		serviceProductDao.insertHotBusi(view);
	}

	public List<HotBusiVo> selectHotBusi(String type) {

		return serviceProductDao.getHotBusi(type);
	}

	public void updateServiceProduct(ServiceProduct pro) {
		// TODO Auto-generated method stub
		serviceProductDao.updateServiceProduct(pro);
	}

}
